<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page import="org.liufeng.course.service.RequestService"%>
<%@ page import="net.sf.json.*"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@page import=" java.text.SimpleDateFormat"%> 
<%
System.out.println(new Date()+"--------------1");
SimpleDateFormat dateformat=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String today=dateformat.format(new Date());
String strDay=today;
try{
	Calendar c = Calendar.getInstance();
	c.setTime(dateformat.parse(today));
	c.add(Calendar.DAY_OF_MONTH, -1);
	strDay = dateformat.format(c.getTime());

}catch(Exception e){
	out.print("出错啦~~");
	
}
String st = strDay;
String et = today;

String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
try{
String json = RequestService.httpRequest("http://fhs.fxpt.org:8090/HyDroDataService/service/queryPPSpace.action","utf-8");
JSONObject ob=JSONObject.fromObject(json);
JSONArray array=ob.getJSONArray("result");


%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<meta name="viewport"
	content="width=device-width,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />

<html>
<head>
<base href="<%=basePath%>">

<title>奉化市重点河道水位、潮位站水位</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<script type="text/javascript" src="js/jquery-1.4.4.min.js"></script>

<style type="text/css">
.info {
	width: 100%;
	background: #c0c0c0;
}

.info td,.info th {
	padding: 4px;
	line-height: 40px;
	font-size: 16;
}

.info td {
	background: #fff;
	text-align: center;
}

.info td.aleft {
	text-align: left;
}

.info td.prohead {
	background: #eaf3ff
}

.info th {
	text-align: center;
	color: #333;
	font-weight: bold;
	verticle-align: middle;
	background: #eee;
	white-space: nowrap;
}

.info tr.overcolor td {
	background: #fcfbcc
}

.info td.prohead {
	background: #6AB4FF
}

.red font {
	color: red;
}

.info tr:hover td {
	background-color: #D1F1F1;
}
</style>
<script type="text/javascript">
	jQuery.ajaxSetup ({
	   		 cache:false
	    })
	    
	 function truan(stcd,STNM){
	 	window.location.href = "rainFallInfo.jsp?stcd="+stcd+"&STNM="+STNM;
	 }
	 
	 
	</script>
</head>

<body>
	<div id="menubox1">
		<p style="color:red">温馨提醒：</p>
		<p style="color:red">点击雨量站后默认进入24小时降雨过程曲线页面，可点击底部自定义查询时间段进行查询选择时间段内的降雨过程线；</p>

		<table class="info" id="info">
			<tr id="th">
				<th>雨量站名</th>
				<th>24h(mm)</th>
				<th>48h(mm)</th>
			</tr>
			<%for(int i=0;i<array.size();i++){
				  String isWarn = array.getJSONObject(i).get("isWarn").toString();

				  String stcd = array.getJSONObject(i).get("STCD").toString();
				  String STNM = array.getJSONObject(i).get("STNM").toString();
				  
			  %>
			<tr id='<%=stcd %>'
				<%if(isWarn.equals("true")){out.print("class='red'");} %>


				onclick="truan('<%=stcd %>','<%=STNM %>')">
				<td><font><%= array.getJSONObject(i).get("STNM")%> </font></td>
				<td><font><%=array.getJSONObject(i).get("H24_DRP")%></font></td>
				<td><font><%=array.getJSONObject(i).get("H48_DRP")%></font></td>
			</tr>
			<%} }catch(Exception e){ %>
			<img src="pic/error.jpg" style="width:100%">
			<%}
			%>
		</table>
	</div>
</body>
</html>
